home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Programming / RxMUI / Examples / Appwin.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-09-23  |  2.4 KB  |  85 lines

  1. /* AppWindowExample */
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. call init
  7. call CreateApp
  8. call HandleApp
  9. /* never reached */
  10. /***********************************************************************/
  11. init: procedure
  12.     l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  13.     if AddLibrary("rxmui.library")~=0 then exit
  14.     call RxMUIOpt("DebugMode ShowErr")
  15.     return
  16. /***********************************************************************/
  17. handleApp: procedure
  18.     ctrl_c=2**12
  19.     do forever
  20.         call NewHandle("APP","H",ctrl_c)
  21.         if and(h.signals,ctrl_c)>0 then exit
  22.         select
  23.             when h.event="QUIT" then exit
  24.             when h.event="APPEVENT" then call appFun(h.to,h.name)
  25.             otherwise interpret h.event
  26.         end
  27.     end
  28.     /* never reached */
  29. /***********************************************************************/
  30. CreateApp: procedure
  31.  
  32.     app.Title="AppWindowExample"
  33.     app.Version="$VER: AppWindowExample 2.1 (11.3.2001)"
  34.     app.Copyright="©2001, alfie"
  35.     app.Author="alfie"
  36.     app.Description="AppWindowExample"
  37.     app.Base="RXMUIEXAMPLE"
  38.     app.SubWindow="win"
  39.      win.Title="AppWindowExample"
  40.      win.AppWindow=1
  41.      win.Contents="mgroup"
  42.       mgroup.frametitle="Drop icons on me!"
  43.       mgroup.0="droplist1"
  44.        droplist1.class="listview"
  45.        droplist1.input=1
  46.        droplist1.list="list"
  47.         list.frame="inputlist"
  48.       mgroup.1="droplist2"
  49.        droplist2.class="listview"
  50.        droplist2.input=1
  51.        droplist2.list="dlist"
  52.         dlist.class="dirlist"
  53.         dlist.frame="inputlist"
  54.  
  55.     res=NewObj("APPLICATION","APP")
  56.     if res~=0 then exit
  57.  
  58.     call Notify("win","closerequest",1,"app","returnid","quit")
  59.     call Notify("droplist1","entries","everytime","droplist1","jump","triggervalue")
  60.  
  61.     call AppMessage("droplist1")
  62.     call AppMessage("droplist2")
  63.     call set("app","DropObject","droplist1")
  64.  
  65.     call set("win","open",1)
  66.     if ~xget("win","open") then do
  67.         say "can't open window"
  68.         exit
  69.     end
  70.  
  71.     return
  72. /***********************************************************************/
  73. halt:
  74. break_c:
  75.     exit
  76. /**************************************************************************/
  77. appFun: procedure
  78. parse arg to,what
  79. say to what
  80.     if to="DROPLIST1" then call DoMethod(to,"insert",what,"bottom")
  81.     else call set("dlist","DIRECTORY",what)
  82.  
  83.     return
  84. /**************************************************************************/
  85.